`ifndef AHBL_MST_TIGHT_TRANSFER_SV
`define AHBL_MST_TIGHT_TRANSFER_SV


class ahbl_mst_tight_transfer extends ahbl2apb_base_test;

	ahbl_mst_simple_burst_seq ahbl_seq_0;
	ahbl_mst_simple_burst_seq ahbl_seq_1;
	apb_slv_nrdy_seq					apb_seq;

	`uvm_component_utils(ahbl_mst_tight_transfer)

	function new(string name = "ahbl_mst_tight_transfer", uvm_component parent = null);
		super.new(name, parent);
	endfunction : new

	function void build_phase(uvm_phase phase);
		super.build_phase(phase);

		ahbl_seq_0 	= ahbl_mst_simple_burst_seq::type_id::create("ahbl_seq_0");
		ahbl_seq_1 	= ahbl_mst_simple_burst_seq::type_id::create("ahbl_seq_1");
		apb_seq			= apb_slv_nrdy_seq::type_id::create("apb_seq");
	endfunction : build_phase

	task main_phase(uvm_phase phase);
		int num_apb_seq;

		super.main_phase(phase);

		phase.raise_objection(this);
		#100ns;
		fork
			begin
				ahbl_seq_0.start(env.ahbl_mst_agt.sequencer);
				ahbl_seq_1.start(env.ahbl_mst_agt.sequencer);
			end
			begin
				num_apb_seq = 0;
				while(1) begin
					apb_seq.start(env.apb_slv_agt.sequencer);
					num_apb_seq ++;
					if(num_apb_seq >= ahbl_seq_0.req.get_burst_beats()) begin
						num_apb_seq = 0;
						break;
					end
				end
				while(1) begin
					apb_seq.start(env.apb_slv_agt.sequencer);
					num_apb_seq ++;
					if(num_apb_seq >= ahbl_seq_1.req.get_burst_beats()) begin
						num_apb_seq = 0;
						break;
					end
				end
			end
		join
		phase.drop_objection(this);
	endtask : main_phase

endclass : ahbl_mst_tight_transfer


`endif // AHBL_MST_TIGHT_TRANSFER_SV
